#include "Student_t.h"
#include "Faculty_t.h"

Faculty_t::Faculty_t(const std::string& name)
	: m_name(name)
{
}

Faculty_t::~Faculty_t()
{
	StudentContainer::const_iterator it = m_students.begin();
	for(; it != m_students.end(); it++)
		delete *it;
	m_students.clear();
}

Student_t* Faculty_t::makeStudent()
{
	// Create concrete student
	Student_t* newStudent = doMakeStudent();

	// Add to student to container
	m_students.insert(newStudent);

	// Return student
	return newStudent;
}

void Faculty_t::notifyPriceRaised() const
{
	StudentContainer::const_iterator it = m_students.begin();
	for(; it != m_students.end(); it++)
		(*it)->update("Price Raised");
}

void Faculty_t::notifyLectureCanceled() const
{
	// Empty
}
